<template>
  <div style="height: 200px">
    <el-table
      :data="list"
      :header-cell-style="{background:'#F5F4F7'}"
      border
      fit
      stripe
      highlight-current-row
      height="150"
      style="width: 100%"
    >
      <el-table-column
        type="index"
        label="序号"
        width="60"
        align="center"
      />
      <el-table-column
        prop="strassetscode"
        label="资产编码"
      />
      <el-table-column
        prop="strassetsname"
        label="资产名称"
        width="120"
        align="center"
      />
      <el-table-column
        prop="stritemstyle"
        label="资产型号"
        width="120"
        align="center"
      />
      <el-table-column
        prop="dblquantity"
        label="数量"
        width="80"
        align="center"
      />
    </el-table>
    <el-pagination
      background
      small
      :current-page.sync="paging.page"
      :page-sizes="[10, 20, 30, 40]"
      :page-size.sync="paging.size"
      layout="total, prev, pager, next"
      :total="paging.total"
      @size-change="getList"
      @current-change="getList"
    />
  </div>
</template>
<script>
import { getInventory } from '@/api/basic-setting/dashboard/dashboard'

export default {
  name: 'Repertory',
  data() {
    return {
      paging: {
        total: 0,
        page: 1,
        size: 10
      },
      list: []
    }
  },
  created() {
    this.getList()
  },
  methods: {
    getList() {
      this.$nextTick(async _ => {
        const res = await getInventory(this.paging.page, this.paging.size)
        if (res.code === 20000) {
          this.list = res.data.rows
          this.paging.total = res.data.total
        }
      })
    }
  }
}
</script>
<style scoped>
</style>
